package com.study.datastructure.sort;

import java.util.Scanner;

/**
 * 冒泡排序优化算法
 */
public class BubbleSort {

    static void sort1(int[] a){
        for(int i=0;i<a.length-1;i++){
            for (int j = 0; j < a.length-i-1; j++) {
                if(a[j]>a[j+1]){
                    int temp = a[j];
                    a[j] = a[j+1];
                    a[j+1] = temp;
                }
            }
        }
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }

    static void sort2(int[] a){
        boolean flag = true;
        for(int i=0;i<a.length-1;i++){
            for (int j = 0; j < a.length-i-1; j++) {
                if(a[j]>a[j+1]){
                    int temp = a[j];
                    a[j] = a[j+1];
                    a[j+1] = temp;
                    flag = false;
                }
            }
            if(flag){
                break;
            }
        }
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }

    static void sort3(int[] a){
        int lastExchangeIndex = 0;
        boolean flag = true;
        int bj = a.length-1;
        for(int i=0;i<a.length-1;i++){
            for (int j = 0; j < bj; j++) {
                if(a[j]>a[j+1]){
                    int temp = a[j];
                    a[j] = a[j+1];
                    a[j+1] = temp;
                    flag = false;
                    lastExchangeIndex = j;
                }
            }
            bj = lastExchangeIndex;
            if(flag){
                break;
            }
        }
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }

    public static void main(String[] args) {
//        int[] a = new int[]{5,3,6,9,4,7,0};
//        sort3(a);
//        System.out.println(""+(5+6));
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        System.out.println(count);
    }

}
